Deprecate and hardcode values for gtk-tooltip* timeouts
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Mon, 8 Jul 2013 17:13:23 +0000 (13:13 -0400)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Mon, 8 Jul 2013 19:02:28 +0000 (15:02 -0400)
gtk/gtksettings.c
gtk/gtkstatusicon.c
gtk/gtktooltip.c
gtk/gtkwidget.c

index 112bf732e48844216f777d89fa04f16da18acd7c..ceaec85ec451b4129008a990e59568756417c51f 100644 (file)
@@ -773,6 +773,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * cursor is hovering on top of a widget.
    *
    * Since: 2.12
+   *
+   * Deprecated: 3.10: This setting is ignored.
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_int ("gtk-tooltip-timeout",
@@ -799,6 +801,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * for the new object.
    *
    * Since: 2.12
+   *
+   * Deprecated: 3.10: This setting is ignored.
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_int ("gtk-tooltip-browse-timeout",
@@ -821,6 +825,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * about browse mode.
    *
    * Since: 2.12
+   *
+   * Deprecated: 3.10: This setting is ignored.
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_int ("gtk-tooltip-browse-mode-timeout",
index c4b0bb4b9763ec5bb1670ab47f786751e0f9e7b4..3e3b92a48b61794aa45d7ad8ee9afbb3523a33e4 100644 (file)
@@ -605,7 +605,7 @@ gtk_status_icon_class_init (GtkStatusIconClass *class)
    * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard
    * @tooltip: a #GtkTooltip
    *
-   * Emitted when the #GtkSettings:gtk-tooltip-timeout has expired with the
+   * Emitted when the hover timeout has expired with the
    * cursor hovering above @status_icon; or emitted when @status_icon got
    * focus in keyboard mode.
    *
index 311dfbdc9f9360df21a59ac136d1cdb6344672bc..7892ef0608b06349690a789a92e28eb2b0ec3c3d 100644 (file)
 
 #undef DEBUG_TOOLTIP
 
+#define HOVER_TIMEOUT          500
+#define BROWSE_TIMEOUT         60
+#define BROWSE_DISABLE_TIMEOUT 500
 
 #define GTK_TOOLTIP_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLTIP, GtkTooltipClass))
 #define GTK_IS_TOOLTIP_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLTIP))
@@ -1351,14 +1354,7 @@ gtk_tooltip_hide_tooltip (GtkTooltip *tooltip)
 
   if (!tooltip->keyboard_mode_enabled)
     {
-      guint timeout;
-      GtkSettings *settings;
-
-      settings = gtk_widget_get_settings (GTK_WIDGET (tooltip->window));
-
-      g_object_get (settings,
-                   "gtk-tooltip-browse-mode-timeout", &timeout,
-                   NULL);
+      guint timeout = BROWSE_DISABLE_TIMEOUT;
 
       /* The tooltip is gone, after (by default, should be configurable) 500ms
        * we want to turn off browse mode
@@ -1414,7 +1410,6 @@ gtk_tooltip_start_delay (GdkDisplay *display)
 {
   guint timeout;
   GtkTooltip *tooltip;
-  GtkSettings *settings;
 
   tooltip = g_object_get_data (G_OBJECT (display),
                               "gdk-display-current-tooltip");
@@ -1425,12 +1420,10 @@ gtk_tooltip_start_delay (GdkDisplay *display)
   if (tooltip->timeout_id)
     g_source_remove (tooltip->timeout_id);
 
-  settings = gtk_widget_get_settings (GTK_WIDGET (tooltip->window));
-
   if (tooltip->browse_mode_enabled)
-    g_object_get (settings, "gtk-tooltip-browse-timeout", &timeout, NULL);
+    timeout = BROWSE_TIMEOUT;
   else
-    g_object_get (settings, "gtk-tooltip-timeout", &timeout, NULL);
+    timeout = HOVER_TIMEOUT;
 
   tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout,
                                                      tooltip_popup_timeout,
index 8a3b0a08657262e7691a9c4cb81fee1bfcb52da4..f2a7005575980671300e14839e43cbaf39693b9f 100644 (file)
@@ -3237,7 +3237,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
    * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard
    * @tooltip: a #GtkTooltip
    *
-   * Emitted when #GtkWidget:has-tooltip is %TRUE and the #GtkSettings:gtk-tooltip-timeout
+   * Emitted when #GtkWidget:has-tooltip is %TRUE and the hover timeout
    * has expired with the cursor hovering "above" @widget; or emitted when @widget got
    * focus in keyboard mode.
    *